package routers

import (
	"FromNowOnPromote/博客系统/Tblog/controllers"
	"FromNowOnPromote/博客系统/Tblog/controllers/Admin"
	"FromNowOnPromote/博客系统/Tblog/controllers/Blog"
	Comment2 "FromNowOnPromote/博客系统/Tblog/controllers/Blog/Comment"
	"FromNowOnPromote/博客系统/Tblog/controllers/Blog/MarkdownManage"
	"FromNowOnPromote/博客系统/Tblog/controllers/Captcha"
	"FromNowOnPromote/博客系统/Tblog/controllers/Fans"
	"FromNowOnPromote/博客系统/Tblog/controllers/Follow"
	"FromNowOnPromote/博客系统/Tblog/controllers/MainPush/HomePage"
	"FromNowOnPromote/博客系统/Tblog/controllers/MainPush/Search"
	"FromNowOnPromote/博客系统/Tblog/controllers/MainPush/TotalPage"
	"FromNowOnPromote/博客系统/Tblog/controllers/User"
	"FromNowOnPromote/博客系统/Tblog/controllers/User/IconUrl"
	"FromNowOnPromote/博客系统/Tblog/controllers/User/UpdateData"
	"FromNowOnPromote/博客系统/Tblog/controllers/User/personal"
	"github.com/astaxie/beego"
)

func init() {
	beego.Router("/", &controllers.MainController{})

	//获取登录验证码接口
	beego.Router("/user/getCheckCode", &Captcha.Captcha{}, "post:GetCaptcha")

	//用户登录接口
	beego.Router("/user/login", &User.LoginController{}, "post:LoginPost")

	//用户注册接口
	beego.Router("/user/register", &User.RegisterController{}, "post:RegisterPost")

	//找回密码接口
	//beego.Router("/User/retrieve",&User.Retrieve{},"post:Retrieve")

	//获取用户信息接口
	beego.Router("/user/getUserInfo", &personal.GetUserInfo{})

	//上传用户头像接口
	beego.Router("/user/icon", &IconUrl.IconUrl{})

	//获取用户头像接口
	beego.Router("/user/icon", &IconUrl.IconUrl{})

	//删除用户token接口
	beego.Router("/user/deltoken", &personal.DelToken{})

	//修改用户信息接口
	beego.Router("/user/updateUser", &UpdateData.UpdateUser{})

	//修改用户密码接口
	beego.Router("/user/updatePassword", &User.Retrieve{})

	//编辑博客接口
	beego.Router("/user/editArticle", &Blog.EditBlog{})

	//用户查看博客信息接口
	beego.Router("/blogInfo/viewArticle", &Blog.ShowBlogs{})

	//查看博客文章接口
	beego.Router("/blogInfo/viewArticle/:username/p/:blogid", &Blog.ViewBlog{})

	//更新博客文章接口
	beego.Router("/blogInfo/updateArticle", &Blog.UpdateBlog{})

	//博客文章禁止评论接口
	beego.Router("/blogInfo/bancomment", &Blog.BanComment{})

	//删除博客文章接口
	beego.Router("/blogInfo/deleteArticle", &Blog.DeleteBlog{})

	//用户阅读博客文章接口
	beego.Router("/tblog/p/:blogid", &Blog.ReadBlog{})

	//关注接口
	beego.Router("/tblog/user/follow", &Follow.Follow{})

	//查看关注信息接口
	beego.Router("/user/follow", &Follow.UserFollow{})

	//取消关注接口
	beego.Router("/user/unfollow", &Follow.UnFollow{})

	//查看粉丝信息接口
	beego.Router("/user/fans", &Fans.FansManage{})

	//获取分页总数接口
	beego.Router("/track", &TotalPage.TotalPage{})

	//首页博客推送接口
	beego.Router("/tblog/blogInfo/queryBlogNoDel", &HomePage.HomePage{})

	//内容搜索接口
	beego.Router("/tblog/search", &Search.Search{})

	//管理员注册接口
	beego.Router("/admin/register", &Admin.AdminRegister{})

	//管理员登录接口
	beego.Router("/admin/login", &Admin.AdminLogin{})

	//管理员内容推送查询接口
	beego.Router("/admin/searchblog", &Admin.BlogManage{}, "get:SendBlog;post:SendRedis")

	//获取推送的文章
	beego.Router("/get/tuisongblog", &Admin.GetTuiSongBlog{})

	//Makrdown截图上传接口
	beego.Router("/user/editArticle/MarkdownUpload", &MarkdownManage.MarkdownUpload{})

	//Markdown获取截图接口
	beego.Router("/getMarkDown", &MarkdownManage.MarkdownPicture{})

	//管理员管理用户接口
	beego.Router("/admin/ManagingUsers", &Admin.BanUser{}, "get:SendUserData;post:BanUser")

	//用户评论接口
	beego.Router("/user/comment", &Comment2.RecvComment{})

	//发送评论数据接口
	beego.Router("/user/showComment", &Comment2.SendComment{})
}
